<template>
	<div class="zp">
		<div class="nav" @click="navigatiodetail" v-for="(item,index) in list" :key="index">
			<img src="@/static/address.png" class="img" alt="">
			<div class="context">
				<div class="namehosp">{{item.name}}</div>
				<div class="address">{{item.address}}</div>
			</div>
			<div class="right"><img src="@/static/addmore.png" alt="" style="width: 15px;height: 15px;"></div>
		</div>
	</div>
</template>

<script>
	import {request} from '@/util/https.js'
	export default{
		data(){
		return{
			list:[]
		}	
		},methods:{
			one(){
				let _self=this;
				request(
				'/choosehosp',
				{},
				'GET',function(res){
					console.log(JSON.parse(JSON.stringify(res.data.data.choosehosp)))
					_self.list=res.data.data.choosehosp
					console.log(_self.list)
					console.log(typeof(_self.list))
					
					
				}
				)
			},
			navigatiodetail(){
				uni.navigateTo({
					url:"./navigatiodetail"
				})
			}
			
		},onShow() {
			this.one()
		}
	}
</script>

<style>
	.address{
		    font-family: 'PingFangSC-Thin', 'PingFang SC Thin', 'PingFang SC', sans-serif;
		    font-weight: 200;
		    font-size: 12px;
		    color: #7F7F7F;
	}
	.namehosp{
		font-size: 15px;font-family: 'PingFangSC-Thin', 'PingFang SC Thin', 'PingFang SC', sans-serif;
    font-style: normal;
	}
	.img{
		width: 40px;
		margin-right: 10px;
		height: 40px;
		
	}
	.context{
		flex: 70%;
	}
	.right{
		flex: 10%;
	}
	.zp{
		padding: 0 10px;
	}
	.nav {
		display: flex;
		justify-content: center;
		align-items: center;
		height: 72px;
		padding: 5px;
		border-bottom: 1px solid rgba(242, 242, 242, 1);
	}
</style>